package com.dwx.guli.service.base.exception;

import com.dwx.guli.service.base.result.ResultCodeEnum;
import lombok.Data;

@Data
public class GuliException extends RuntimeException {
    private Integer code;
    public GuliException(Integer code,String message){
        super(message);
        this.code=code;
    }
    public GuliException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code=resultCodeEnum.getCode();
    }
    @Override
    public String toString() {
        return "GuliException{" +
                "code=" + code +
                "message"+this.getMessage()+
                '}';
    }
}
